package com.hccl.mongoEntities;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import entities.JsonCommand;
import entities.NoMatchOrInput;
import entities.Reply;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Property;


/**
 * 语义要素变量实体
 */

@Entity(value = "variables", noClassnameStored = true)
public class GrammarVariableEntity {
    @Id
    @JsonIgnore
    protected ObjectId id;
    protected String name;
    protected List<Reply> param_reply = new ArrayList<>();
    protected Reply helpreply;
    protected Reply reListenreply;
    protected NoMatchOrInputEntity noMatch;
    protected NoMatchOrInputEntity noInput;
    protected List<String> defaultFunction=new ArrayList<String>();
    protected String defaultValue;
    protected String type;
    protected String runtime;
    protected List<CommandEntity> commands = new ArrayList<>();


    public GrammarVariableEntity() {
        super();
    }

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Reply> getParam_reply() {
        return param_reply;
    }

    public void setParam_reply(List<Reply> param_reply) {
        this.param_reply = param_reply;
    }

    public Reply getHelpreply() {
        return helpreply;
    }

    public void setHelpreply(Reply helpreply) {
        this.helpreply = helpreply;
    }

    public Reply getReListenreply() {
        return reListenreply;
    }

    public void setReListenreply(Reply reListenreply) {
        this.reListenreply = reListenreply;
    }

    public NoMatchOrInputEntity getNoMatch() {
        return noMatch;
    }

    public void setNoMatch(NoMatchOrInputEntity noMatch) {
        this.noMatch = noMatch;
    }

    public NoMatchOrInputEntity getNoInput() {
        return noInput;
    }

    public void setNoInput(NoMatchOrInputEntity noInput) {
        this.noInput = noInput;
    }

    public String getRuntime() {
        return runtime;
    }

    public void setRuntime(String runtime) {
        this.runtime = runtime;
    }

    public List<CommandEntity> getCommands() {
        return commands;
    }

    public void setCommands(List<CommandEntity> commands) {
        this.commands = commands;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String value) { this.defaultValue = value; }

    public List<String> getDefaultFunction(){return defaultFunction;}

    public String getDefaultFunctionString(){
        String s="";
        for (String ss:defaultFunction)s=s+ss+",";
        if(defaultFunction.size()>0)s=s.substring(0,s.length()-1);
        return s;
    }

    public void setDefaultFunction(List<String> defaultFunction){this.defaultFunction=defaultFunction;}


}
